package cn.elwin.samples;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class MainActivity extends Activity {

	private Button button_form_widgets;
	private Button button_text_fields;
	private Button button_layouts;
	private Button button_composite;
	private Button button_images_and_media;
	private Button button_time_and_date;
	private Button button_transitions;
	private Button button_advanced;
	private Button button_other;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);

		button_form_widgets = (Button) findViewById(R.id.button_form_widgets);
		button_text_fields = (Button) findViewById(R.id.button_text_fields);
		button_layouts = (Button) findViewById(R.id.button_layouts);
		button_composite = (Button) findViewById(R.id.button_composite);
		button_images_and_media = (Button) findViewById(R.id.button_images_and_media);
		button_time_and_date = (Button) findViewById(R.id.button_time_and_date);
		button_transitions = (Button) findViewById(R.id.button_transitions);
		button_advanced = (Button) findViewById(R.id.button_advanced);
		button_other = (Button) findViewById(R.id.button_other);

		button_form_widgets.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				// TODO Auto-generated method stub
				Intent intent = new Intent();
				intent.setClass(MainActivity.this, FormWidgets.class);
				MainActivity.this.startActivity(intent);
			}
		});

		button_text_fields.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				// TODO Auto-generated method stub
				Intent intent = new Intent();
				intent.setClass(MainActivity.this, TextFields.class);
				MainActivity.this.startActivity(intent);
			}
		});
		
		button_layouts.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				// TODO Auto-generated method stub
				Intent intent = new Intent();
				intent.setClass(MainActivity.this, Layouts.class);
				MainActivity.this.startActivity(intent);
			}
		});
		
		button_composite.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				// TODO Auto-generated method stub
				Intent intent = new Intent();
				intent.setClass(MainActivity.this, Composite.class);
				MainActivity.this.startActivity(intent);
			}
		});
		
		button_images_and_media.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				// TODO Auto-generated method stub
				Intent intent = new Intent();
				intent.setClass(MainActivity.this, ImagesAndMedia.class);
				MainActivity.this.startActivity(intent);
			}
		});
		
		button_time_and_date.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				// TODO Auto-generated method stub
				Intent intent = new Intent();
				intent.setClass(MainActivity.this, TimeAndDate.class);
				MainActivity.this.startActivity(intent);
			}
		});
		
		button_transitions.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				// TODO Auto-generated method stub
				Intent intent = new Intent();
				intent.setClass(MainActivity.this, Transitions.class);
				MainActivity.this.startActivity(intent);
			}
		});
		
		button_advanced.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				// TODO Auto-generated method stub
				Intent intent = new Intent();
				intent.setClass(MainActivity.this, Advanced.class);
				MainActivity.this.startActivity(intent);
			}
		});
				
		button_other.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				// TODO Auto-generated method stub
				Intent intent = new Intent();
				intent.setClass(MainActivity.this, Other.class);
				MainActivity.this.startActivity(intent);
			}
		});
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.main, menu);
		return true;
	}

}
